home *** CD-ROM | disk | FTP | other *** search
- unit SrvMain;
- interface
- uses
- ComObj, ActiveX, Srv_TLB, StdVcl;
- type
- TRegObj = class(TAutoObject, IRegObj)
- private
- FRegCookie: Integer;
- protected
- procedure AddString(const Value: WideString); safecall;
- public
- destructor Destroy; override;
- procedure Initialize; override;
- end;
-
- implementation
- uses ComServ, Dialogs, SrvU;
- { TRegObj }
- destructor TRegObj.Destroy;
- begin
- RevokeActiveObject(FRegCookie, nil);
- inherited Destroy;
- end;
-
- procedure TRegObj.Initialize;
- begin
- inherited Initialize;
- OleCheck(RegisterActiveObject(Self, CLASS_RegObj, ACTIVEOBJECT_WEAK, FRegCookie));
- end;
-
- procedure TRegObj.AddString(const Value: WideString);
- begin
- MainForm.Memo.Lines.Add(Value);
- end;
-
- initialization
- TAutoObjectFactory.Create(ComServer, TRegObj, Class_RegObj,
- ciMultiInstance, tmApartment);
- end.
-